package cn.office.utils;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class FileContentTypeUtil implements Serializable {
    public static final Map<String, String> types = new HashMap<String, String>() {
        private static final long serialVersionUID = 1L;

        {
            this.put("atom", "application/atom+xml");
            this.put("woff", "application/font-woff");
            this.put("jar", "application/java-archive");
            this.put("war", "application/java-archive");
            this.put("ear", "application/java-archive");
            this.put("js", "application/javascript");
            this.put("json", "application/json");
            this.put("hqx", "application/mac-binhex40");
            this.put("doc", "application/msword");
            this.put("pdf", "application/pdf");
            this.put("ps", "application/postscript");
            this.put("eps", "application/postscript");
            this.put("ai", "application/postscript");
            this.put("rss", "application/rss+xml");
            this.put("rtf", "application/rtf");
            this.put("m3u8", "application/vnd.apple.mpegurl");
            this.put("kml", "application/vnd.google-earth.kml+xml");
            this.put("kmz", "application/vnd.google-earth.kmz");
            this.put("xls", "application/vnd.ms-excel");
            this.put("eot", "application/vnd.ms-fontobject");
            this.put("ppt", "application/vnd.ms-powerpoint");
            this.put("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
            this.put("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
            this.put("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
            this.put("wmlc", "application/vnd.wap.wmlc");
            this.put("7z", "application/x-7z-compressed");
            this.put("cco", "application/x-cocoa");
            this.put("xhtml", "application/xhtml+xml");
            this.put("jardiff", "application/x-java-archive-diff");
            this.put("jnlp", "application/x-java-jnlp-file");
            this.put("run", "application/x-makeself");
            this.put("pl", "application/x-perl");
            this.put("pm", "application/x-perl");
            this.put("prc", "application/x-pilot");
            this.put("pdb", "application/x-pilot");
            this.put("rar", "application/x-rar-compressed");
            this.put("rpm", "application/x-redhat-package-manager");
            this.put("sea", "application/x-sea");
            this.put("swf", "application/x-shockwave-flash");
            this.put("xspf", "application/xspf+xml");
            this.put("sit", "application/x-stuffit");
            this.put("tcl", "application/x-tcl");
            this.put("tk", "application/x-tcl");
            this.put("der", "application/x-x509-ca-cert");
            this.put("pem", "application/x-x509-ca-cert");
            this.put("crt", "application/x-x509-ca-cert");
            this.put("xpi", "application/x-xpinstall");
            this.put("zip", "application/zip");
            this.put("mid", "audio/midi");
            this.put("midi", "audio/midi");
            this.put("kar", "audio/midi");
            this.put("mp3", "audio/mpeg");
            this.put("ogg", "audio/ogg");
            this.put("m4a", "audio/x-m4a");
            this.put("ra", "audio/x-realaudio");
            this.put("gif", "image/gif");
            this.put("jpeg", "image/jpeg");
            this.put("jpg", "image/jpeg");
            this.put("png", "image/png");
            this.put("svg", "image/svg+xml");
            this.put("svgz", "image/svg+xml");
            this.put("tif", "image/tiff");
            this.put("tiff", "image/tiff");
            this.put("wbmp", "image/vnd.wap.wbmp");
            this.put("webp", "image/webp");
            this.put("ico", "image/x-icon");
            this.put("jng", "image/x-jng");
            this.put("bmp", "image/x-ms-bmp");
            this.put("css", "text/css");
            this.put("html", "text/html");
            this.put("shtml", "text/html");
            this.put("htm", "text/html   ");
            this.put("mml", "text/mathml");
            this.put("txt", "text/plain");
            this.put("jad", "text/vnd.sun.j2me.app-descriptor");
            this.put("wml", "text/vnd.wap.wml");
            this.put("htc", "text/x-component");
            this.put("xml", "text/xml");
            this.put("3gpp", "video/3gpp");
            this.put("3gp", "video/3gpp");
            this.put("ts", "video/mp2t");
            this.put("mp4", "video/mp4");
            this.put("mpeg", "video/mpeg");
            this.put("mpg", "video/mpeg");
            this.put("mov", "video/quicktime");
            this.put("webm", "video/webm");
            this.put("flv", "video/x-flv");
            this.put("m4v", "video/x-m4v");
            this.put("mng", "video/x-mng");
            this.put("asx", "video/x-ms-asf");
            this.put("asf", "video/x-ms-asf");
            this.put("avi", "video/x-msvideo");
            this.put("wmv", "video/x-ms-wmv");
        }
    };

    public static String getMIMEType(String suffix) {
        return (String)types.get(suffix);
    }

}
